﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ChiettinhKhachSan.aspx.cs" Inherits="DLV.BackEnd.Pages.ChiettinhKhachSan" %>
<%@ Register Assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" Namespace="System.Web.UI" TagPrefix="asp" %>
<%@ Import Namespace="System.Globalization" %>
<%@ Import Namespace="DLV.Data.Entities" %>
<%@ Import Namespace="DLV.Library.Utilities" %>

<asp:content id="Content1" contentplaceholderid="placeHolderContent" runat="server">
    <style>
        .report {
            margin-top: 40px;
        }

        .head {
            width: 100%;
            overflow: hidden;
        }

            .head > .logo {
                width: 20%;
                float: left;
                margin-right: 1%;
            }

                .head > .logo img {
                    display: block;
                    margin: 0 auto;
                }

            .head > .table {
                width: 78%;
                float: right;
            }

                .head > .table > table {
                    width: 100%;
                    border-top: 1px solid #000;
                    border-left: 1px solid #000;
                }

                    .head > .table > table th {
                        padding: 10px 0;
                        font-size: 20px;
                        border-bottom: 1px solid #000;
                        border-right: 1px solid #000;
                        background-color: #F2DCDB;
                    }

                    .head > .table > table td {
                        padding: 7px;
                        border-bottom: 1px solid #000;
                        border-right: 1px solid #000;
                    }

        .service {
            width: 100%;
            margin-top: 20px;
        }

            .service > table {
                width: 100%;
                margin-bottom: 20px;
                border-top: 1px solid #000;
                border-left: 1px solid #000;
            }

                .service > table th {
                    padding: 5px 0;
                    border-bottom: 1px solid #000;
                    border-right: 1px solid #000;
                    background-color: #F2DCDB;
                }

                    .service > table th.first {
                        background-color: #92CDDC;
                        width: 8%;
                    }

                .service > table td {
                    padding: 7px;
                    border-bottom: 1px solid #000;
                    border-right: 1px solid #000;
                }

                .service > table .tr {
                    text-align: right;
                }

        div {
            margin: 0;
            padding: 0;
        }
    </style>
    
    <div class="report">
        <div class="head">
            <div class="logo">
                <a href="http://dulichviet.com.vn"><img src="/images/logo.png" /></a>
            </div>    
            <div class="table">
                <table cellpadding="0" cellspacing="0" border="0">
                    <tr>
                        <th colspan="4">BẢNG TÍNH GIÁ</th>
                    </tr>
                    <tr>
                        <td><b>Tên đoàn</b></td>
                        <td><%=tourInfo.TourName%></td>
                        <td><b>Code đoàn</b></td>
                        <td>DLV<%=tourInfo.TourId%></td>
                    </tr>
                    <tr>
                        <td><b>Loại hình đoàn</b></td>
                        <td><%=tourInfo.GroupType%></td>
                        <td><b>Loại tour</b></td>
                        <td><%=tourInfo.TourTypeId%></td>
                    </tr>
                    <tr>
                        <td><b>Điểm khởi hành</b></td>
                        <td><%=tourInfo.LocationBegin%></td>
                        <td><b>Hành trình</b></td>
                        <td><%=tourInfo.ScheduleId%></td>
                    </tr>
                    <tr>
                        <td><b>Số lượng khách</b></td>
                        <td>Người lớn: <%=tourInfo.QuantityAdult%> | Trẻ em: <%=tourInfo.QuantityChild%></td>
                        <td><b>Đối tượng khách</b></td>
                        <td>Chọn đối tượng khách</td>
                    </tr>
                    <tr>
                        <td><b>Số hướng dẫn viên</b></td>
                        <td>Chọn số</td>
                        <td><b>Yêu cầu</b></td>
                        <td>Chọn loại HDV</td>
                    </tr>
                    <tr>
                        <td><b>Ngày khởi hành</b></td>
                        <td><%=tourInfo.BeginDate%></td>
                        <td><b>Ngày kết thúc</b></td>
                        <td><%=tourInfo.EndDate%></td>
                    </tr>
                    <tr>
                        <td><b>Tổng số ngày</b></td>
                        <td><%=tourInfo.QuantityDay%></td>
                        <td><b>Tổng số đêm</b></td>
                        <td><%=tourInfo.QuantityNight%></td>
                    </tr>
                     <tr>
                        <td><b>Mùa</b></td>
                        <td><%=tourInfo.Season%></td>
                        <td><b>Thị trường</b></td>
                        <td><%=tourInfo.MartName%></td>
                    </tr>
                </table>
            </div>
        </div>
        
         <%--KHÁCH SẠN--%>
           <div class="service">
            <table cellpadding="0" cellspacing="0" border="0">
                <tr>
                    <th rowspan="2" class="first">LƯU TRÚ</th>
                    <th rowspan="2">LOẠI KHÁCH SẠN</th>
                    <th rowspan="2">QUỐC GIA</th>
                    <th rowspan="2">TỈNH/THÀNH PHỐ</th>
                    <th rowspan="2">KHÁCH SẠN</th>
                    <th rowspan="2">NGÀY CHECK IN</th>
                    <th rowspan="2">NGÀY CHECK OUT</th>
                    <th rowspan="2">SỐ ĐÊM</th>
                    <th rowspan="2">LOẠI PHÒNG</th>
                    <th colspan="2">GIÁ PHÒNG</th>
                    <th colspan="2">SỐ LƯỢNG PHÒNG</th>
                    <th rowspan="2">VAT</th>
                    <th rowspan="2">TỔNG</th>
                    <th rowspan="2"></th>
                </tr>
                <tr>
                    <th>NGƯỜI LỚN</th>
                    <th>TRẺ EM</th>
                    <th>NGƯỜI LỚN</th>
                    <th>TRẺ EM</th>
                </tr>

                <% foreach (DLV.Data.Entities.CalculatorInfo calculatorInfo in TicketHotel)
                   { %>
                <tr class="ListHotel" id="ticket-hotel-<%=calculatorInfo.CalculatorId%>">
                    <td></td>
                    <td><%=calculatorInfo.HotelTypeName%></td>
                    <td><%=calculatorInfo.NationalName%></td>
                    <td><%=calculatorInfo.CityName%></td>
                    <td><%=calculatorInfo.HotelFullName%></td>
                    <td><%=calculatorInfo.DateBegin.ToShortDateString()%></td>
                    <td><%=calculatorInfo.DateEnd.ToShortDateString()%></td>
                    <td><%=(calculatorInfo.DateEnd - calculatorInfo.DateBegin).Days%></td>
                    <td><%=calculatorInfo.RoomTypeName%></td>
                    <td><%=calculatorInfo.PriceAdults.ToString("#,###", new CultureInfo("vi-VN"))%></td>
                    <td><%=calculatorInfo.PriceChild.ToString("#,###", new CultureInfo("vi-VN"))%></td>
                    <td><%=calculatorInfo.QuantityAdults%></td>
                    <td><%=calculatorInfo.QuantityChild%></td>
                    <td><%=calculatorInfo.Vat%></td>
                    <td><%=(calculatorInfo.TotalPriceHotelAdults+calculatorInfo.TotalPriceHotelChild).ToString("#,###", new CultureInfo("vi-VN"))%></td>
                    <td>
                        <input class="btnUpdateHotel"  type="button" value="Cập nhật" calculatorid="<%=calculatorInfo.CalculatorId%>" />
                        <input class="btnDeleteHotel"  type="button" value="Xóa" calculatorid="<%=calculatorInfo.CalculatorId%>" />
                    </td>
                </tr>
                
                <%} %>
                <tr></tr>
                 <tr id="new-ticket-Hotel">
                    <td></td>
                    <td><asp:DropDownList ID="ddlHotelType" runat="server" Width="70px"></asp:DropDownList></td>
                    <td><asp:DropDownList ID="ddlNational" runat="server" Width="70px"></asp:DropDownList></td>
                    <td><asp:DropDownList ID="ddlCity" runat="server" Width="70px"></asp:DropDownList></td>
                    <td><asp:DropDownList ID="ddlHotel" runat="server" Width="70px"></asp:DropDownList></td>
                    <td><input type="text" id="dteBeginDate" style="width:100px;" placeholder="Clic chọn ngày" readonly="readonly" runat="server" /></td>
                    <td><input type="text" id="dteEndDate" style="width:100px;" placeholder="Click chọn ngày" readonly="readonly" runat="server" /></td>
                    <td><asp:Label runat="server" ID="lbCountNight"></asp:Label></td>
                    <td><asp:DropDownList ID="ddlRoomType" runat="server" Width="50px"></asp:DropDownList></td>
                    <td><asp:TextBox id="txtPriceAdultsRoom" runat="server" Width="50px"></asp:TextBox></td>
                    <td><asp:TextBox id="txtPriceChildsRoom" runat="server" Width="50px"></asp:TextBox></td>
                    <td><asp:TextBox id="txtQuantityAdults" runat="server" Width="50px"></asp:TextBox></td>
                    <td><asp:TextBox id="txtQuantityChild" runat="server" Width="50px"></asp:TextBox></td>
                    <td><asp:TextBox ID="txtVATHotel" runat="server" Width="50px"></asp:TextBox></td>
                    <td><asp:Label id="lbTotalPriceRoom" runat="server" Width="50px"></asp:Label></td>
                    
                    <td id="toolbar-save" class="button">
						 <input  id="btnInsertHotel" class="btnsave" type="button" value="Thêm" calculatorid="-1"/>
                        <input id="btnDeleteHotel" class="btnDeleteHotel"  type="button" value="Hủy" calculatorid="-1" />
					</td>
                </tr>
                <tr>
                    <td></td>
                    <td colspan="13"><b>TỔNG CHI PHÍ ĐOÀN</b></td>
                    <td class="tr" id="TotalTicketHotelPrices"><%=TotalTicketHotelPrices.ToString("#,###", new CultureInfo("vi-VN"))%></td>
                </tr>
                <tr>
                    <td></td>
                    <td colspan="13"><b>TỔNG CHI PHÍ/ KHÁCH NGƯỜI LỚN</b></td>
                    <td class="tr" id="TotalTicketHotelPricesAdults"><%=TotalTicketHotelPricesAdults.ToString("#,###", new CultureInfo("vi-VN"))%></td>
                </tr>
                <tr>
                    <td></td>
                    <td colspan="13"><b>TỔNG CHI PHÍ/ KHÁCH NGƯỜI LỚN</b></td>
                 <td class="tr" id="TotalTicketHotelPricesChild"><%=TotalTicketHotelPricesChild.ToString("#,###", new CultureInfo("vi-VN"))%></td>
                </tr>
 
        </table>
               
               </div>

    </div>
    <link rel="stylesheet" href="/css/datepicker/jquery.ui.all.css" />
	<script type="text/javascript" src="/js/ui/jquery.ui.core.js"></script>
	<script type="text/javascript" src="/js/ui/jquery.ui.datepicker.js"></script>
	<script type="text/javascript">
	    $(function () {
	        $("#<%= dteBeginDate.ClientID%>").datepicker({
	            changeMonth: true,
	            changeYear: true,
	            dateFormat: "dd/mm/yy"
	        });


	        $("#<%= dteEndDate.ClientID%>").datepicker({
	            changeMonth: true,
	            changeYear: true,
	            dateFormat: "dd/mm/yy"
	        });
	    });
	</script>
    

    <script src="/js/jquery.address.js"></script>
    <script src="/js/jquery.ChietTinhKhachSan.js"></script>
    <script type="text/javascript">
        $(document).ready(function () {
            $('#btnDeleteHotel').hide();
            loadCityByNational('#<%=ddlNational.ClientID%>', '#<%=ddlCity.ClientID%>');
            loadHotelByHotelType('#<%=ddlHotelType.ClientID%>', '#<%=ddlHotel.ClientID%>', '#<%=ddlCity.ClientID%>');
            loadRoomTypeByHotel('#<%=ddlHotel.ClientID%>', '#<%=ddlRoomType.ClientID%>', '<%= tourInfo.Season%>');
            <%--loadCountNight('#<%=dteBeginDate.ClientID%>', '#<%=dteEndDate.ClientID%>', '#<%=lbCountNight.ClientID%>');--%>
            loadPriceRoom('#<%=ddlRoomType.ClientID%>', '#<%=dteBeginDate.ClientID%>', '#<%=txtPriceAdultsRoom.ClientID%>', '#<%=txtPriceChildsRoom.ClientID%>');

            InsertCalculatorHotel('#<%=ddlHotelType.ClientID%>', '#<%=ddlNational.ClientID%>', '#<%=ddlCity.ClientID%>', '#<%=ddlHotel.ClientID%>',
                '<%=tourInfo.TourId%>', '#<%=ddlRoomType.ClientID%>', '#<%=dteBeginDate.ClientID%>', '#<%=dteEndDate.ClientID%>',
                '#<%=txtQuantityAdults.ClientID%>', '#<%=txtQuantityChild.ClientID%>', '#<%=txtPriceAdultsRoom.ClientID%>',
                '#<%=txtPriceChildsRoom.ClientID%>', '#<%=txtVATHotel.ClientID%>', '#<%=lbTotalPriceRoom.ClientID%>',
                '#<%=lbCountNight.ClientID%>', '<%= tourInfo.Season%>', '<%= tourInfo.TourId%>');
        });
    </script>
</asp:content>
<%--RoomType lưu id Price--%>

